/**
 * 
 */
package org.jenkon.core.converter;

import org.jenkon.commons.lang.converter.Converter;

/**
 * Convert a given class name to a correct bean name.
 * 
 * @author Jens Konopka
 * 
 */
public class BeanNameConverter implements Converter<Class<?>, String> {

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.jenkon.commons.converter.Converter#convert(java.lang.Object)
	 */
	@Override
	public String convert(final Class<?> clz) throws Exception {

		final String name = clz.getSimpleName();

		final StringBuilder sb = new StringBuilder();
		sb.append(name.substring(0, 1).toLowerCase());
		sb.append(name.substring(1));

		return sb.toString();

	}

}
